<%--
  Created by IntelliJ IDEA.
  User: TYZ
  Date: 2020/3/12
  Time: 19:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!-- f标签 取得jsp一些函数工具 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="f"%>
<!-- 格式化标签 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form id="updateForm">
    <input type="hidden" id="roleId" name="roleId" value="${role.roleId }"><br>
    角色名：<input type="text" id="roleName" name="roleName" value="${role.roleName }"><br>
    请选择权限：<ul id="menuZtree" class="ztree"></ul>
</form>
    <script type="text/javascript">
        $(function(){
            var roleId = $("#roleId").val();
            var setting = {
                async: {
                    enable: true,
                    url:"<%=path %>/menuController/getCheckedZTree/"+roleId,
                    autoParam: ["id", "name"]
                },
                check: {
                    enable: true,
                    chkStyle: "checkbox",
                    chkboxType: {"Y": "p", "N": "s"}
                }
            };
            $.fn.zTree.init($("#menuZtree"), setting);
        })
    </script>
</body>
</html>
